/*
{
"状态":1,
"名称":"修改-季节资料",
"作者":"陈泽椿",
"创建时间":"2018-06-30",
"功能":"修改-季节资料",
"log": [
	{"date":"06-01" , "dev" :"hzhh" , "content" : ""}
]
}
*/
declare @season_id int ,@season_code varchar(100), @season_name varchar(100)
declare @remarks varchar(100)

set @season_id = '{season_id}'
set @season_code = '{season_code}'
set @season_name ='{season_name}' 
set @remarks = '{remarks}'


--校验信息
if isnull(@season_code,'')=''
begin 
	RAISERROR ('SQL:季节编号不允许为空', 16 ,1 ) ; 
	return 
end 


if isnull(@season_name,'')=''
begin 
	RAISERROR ('SQL:季节名称不允许为空', 16 ,1 ) ; 
	return 
end 


if EXISTS(SELECT * FROM b_season WHERE [season_id] <> @season_id and [season_code]=@season_code )
begin
	RAISERROR ('SQL:季节编号已经存在', 16 ,1 ) ; 
	return 
end


update [dbo].[b_season] set
[season_code] = @season_code ,
[season_name] = @season_name ,
[remarks] = @remarks , 
[update_time] = getdate(),
[update_user] = 0
where [season_id] = @season_id
